
var openCasoClinico = function(slide){
	var url = "../slide/1.php";
	if(slide && slide!=''){
		url = "../slide/"+slide+".php";
	}
	location.href = url;
};

var currentUser;
var setAmministratore = function(admin){
	
	$.ajax({
		   url: '../appcontroller.php?cmd=setrole&admin='+admin+'&currentUser='+currentUser,
		   success: function(result) {
			   console.log(result);
			   if(result){
				   var res = eval('('+result+')');
				   if(res.success ){
					   //Imposto l'immagine al record
					   $('#img_'+currentUser).attr('src', (admin==1 ? '../img/user.png' : ''));
				   }else {
					   alert(res.msg);
				   }
			   }
			   
			   //window.location.reload();
		   },
		   fail: function(){
			   alert('fail');
		   }
		});
};
